package com.tqw.client.vo;

import com.tqw.shipping.feign.ShippingDTO;
import com.tqw.vo.ShippingVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * @author Will
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class ReceivingVO {

    private String shippingAddress;
    private String area;

    private String consignee;
    private String phone;
    private Integer addressId;
    private String addressDetail;
    private Integer provinceId;
    private String provinceName;
    private Integer cityId;
    private String cityName;
    private Integer regionId;
    private String regionName;
    private Integer streetId;
    private String streetName;
    private Integer isDefault;

    public ReceivingVO(ShippingDTO shippingDTO) {
        this.shippingAddress = shippingDTO.getProvinceName()
                + shippingDTO.getCityName()
                + shippingDTO.getRegionName()
                + shippingDTO.getStreetName()
                + shippingDTO.getAddressDetail();
        this.area = shippingDTO.getProvinceName()
                + shippingDTO.getCityName()
                + shippingDTO.getRegionName()
                + shippingDTO.getStreetName();

        this.consignee = shippingDTO.getConsignee();
        this.phone = shippingDTO.getPhone();
        this.addressId = shippingDTO.getAddressId();
        this.addressDetail = shippingDTO.getAddressDetail();
        this.provinceId = shippingDTO.getProvinceId();
        this.provinceName = shippingDTO.getProvinceName();
        this.cityId = shippingDTO.getCityId();
        this.cityName = shippingDTO.getCityName();
        this.regionId = shippingDTO.getRegionId();
        this.regionName = shippingDTO.getRegionName();
        this.streetId = shippingDTO.getStreetId();
        this.streetName = shippingDTO.getStreetName();
        this.isDefault = shippingDTO.getIsDefault();
    }

    public ReceivingVO(ShippingVO shippingVO) {
        this.shippingAddress = shippingVO.getProvinceName()
                + shippingVO.getCityName()
                + shippingVO.getRegionName()
                + shippingVO.getStreetName()
                + shippingVO.getAddressDetail();
        this.area = shippingVO.getProvinceName()
                + shippingVO.getCityName()
                + shippingVO.getRegionName()
                + shippingVO.getStreetName();

        this.consignee = shippingVO.getConsignee();
        this.phone = shippingVO.getPhone();
        this.addressId = shippingVO.getAddressId();
        this.addressDetail = shippingVO.getAddressDetail();
        this.provinceId = shippingVO.getProvinceId();
        this.provinceName = shippingVO.getProvinceName();
        this.cityId = shippingVO.getCityId();
        this.cityName = shippingVO.getCityName();
        this.regionId = shippingVO.getRegionId();
        this.regionName = shippingVO.getRegionName();
        this.streetId = shippingVO.getStreetId();
        this.streetName = shippingVO.getStreetName();
        this.isDefault = shippingVO.getIsDefault();
    }

}
